select rpag, rpaap, rpan8, RPUSER, RPUPMJ, RPUPMT, rpan8 ||'0000000001', RPMCU from C0053PRDD/F03B11
where
RPPST='A'
AND RPAN8=1174479

select sum(rpag)*0.01 as Gross,sum(rpaap)*0.01 as Open from c0053prdd/f03b11 
where rppst = 'A'
AND RPAN8=6991050

select * from C0053PRDD/F03B11
where
RPPST='A'
AND RPAN8=1174479



select sum(rpag)*0.01 as Gross,sum(rpaap)*0.01 as Open from c0053prdd/f03b11 
where rppst = 'A' AND RPMCU='         005'
AND RPAN8=3688813

select sum(rpag)*0.01 as Gross,sum(rpaap)*0.01 as Open from c0053prdd/f03b11 
join c0053prdd/f03012 on rpan8 = aian8
where aiac04 = '002' and rppst = 'A'



select sum(rpag)*0.01 as Gross,sum(rpaap)*0.01 as Open from c0053prdd/f03b11 
where rppst = 'A' AND RPMCU='         058'
/**

-- 005
GROSS		OPEN
836657.86	841264.45

-- 058
GROSS		OPEN
515793.54	489476.94

**/

select * from c0053prdd/f03b11 
where rppst = 'A' AND RPMCU='         002'


select SDLITM, SDITM FROM C0053PRDD/F42119
where
SDdoco='51929173'




select sum(rpag)*0.01 as Gross,sum(rpaap)*0.01 as Open from c0053prdd/f03b11 
where RPAN8='3207894'



select sum(rpag)*0.01 as Gross,sum(rpaap)*0.01 as Open from c0053prdd/f03b11 
where rppst = 'A'




select rpmcu, sum(rpag)*0.01 as Gross,sum(rpaap)*0.01 as Open from c0053prdd/f03b11 
where rppst = 'A'
group by RPmcu
order by rpmcu


select rpan8, rpmcu, sum(rpag)*0.01 as Gross,sum(rpaap)*0.01 as Open from c0053prdd/f03b11 
where rppst = 'A'
and rpmcu in ('         055','        1380','        1446','        1447','        1486','        1783') 
group by RPan8, rpmcu
order by rpmcu





select * from c0053prdd/f03b11 
where rppst = 'A' and rpan8='3207894'



select rpmcu, sum(rpag)*0.01 as Gross,sum(rpaap)*0.01 as Open  from c0053prdd/f03b11 
where rppst = 'A' and rpan8='3207894'

select RPDOC, RPDCT, RPPST, RPTORG, RPUSER, DATE(CHAR(RPUPMJ+1900000)),RPUPMJ, RPUPMT, RPPID from c0053prdd/f03b11 
where rppst = 'A' and rpan8='3207894'
and RPDOC='2501435'


select DATE(CHAR(RPUPMJ+1900000)) from c0053prdd?f03b11
where rpan8 = 1104075
and rpdoc = 15611960
